<div class="contentr fr">
    <div class="cr">
        <p>黑名单</p>
    </div>
    <div class=" ml32 mt15">
        <form action="" method="post">
            <div class="ml60">
                <i>*</i>对方帐号: <input name="user2" type="text" maxlength="30" class="kuang2"><i class="ml5">请输入对方账号</i></div>
            <div class="mt15 ml60">
                <span><i>*</i>备注内容: </span>
                <input  type="text" maxlength="10" class=" kuang2" name="remark" />
            </div>
            <p class=" mt25"><em>1.被拉黑或者拉黑会员后双方无法进行任务，也无法进行聊天，请注意。</em> </p>
            <p class="mt10">2.购买VIP的会员屏蔽了对应的商家会员后参加任务时勾选黑名单进行筛选任务就不会显示到对应商家的任务（最高屏蔽60位，商家忽略此功能）。</p>
            <p class="mt10">3.开启屏蔽：则勾选黑名单功能后，不显示商家任务，且无法申请商家任务（商家忽略此功能）。</p>
            <p class="mt10">4.关闭屏蔽：则勾不勾选黑名单功能，都显示商家任务，但无法申请商家任务（商家忽略此功能）。</p>
            <p class="mt10">PS：开启屏蔽超过60个后，如还想开启的话，请先关闭其他人，再开启。</p>
            <div>
                <input class="submit_reg mt25 ml145" type="submit" value="添加" />
            </div>
        </form>
    </div>
    <div class=" mt45">
        <table width="975" height="40" border="1" cellspacing="0" bordercolor="#dcdcdc" >
            <tr>
                <td align="center" bgcolor="#fef7f2">流水号</td>
                <td align="center" bgcolor="#fef7f2">添加用户</td>
                <td align="center" bgcolor="#fef7f2">被添加用户</td>
                <td align="center" bgcolor="#fef7f2">屏蔽</td>
                <td align="center" bgcolor="#fef7f2">备注</td>
                <td align="center" bgcolor="#fef7f2">日期</td>
                <td align="center" bgcolor="#fef7f2">操作</td>
            </tr>
            <?php foreach($blacklist as $bl){ ?>
            <tr>
                <td align="center"><?php echo $bl->serial; ?></td>
                <td align="center"><?php echo $user->account; ?></td>
                <td align="center"><?php echo $bl->account; ?></td>
                <td align="center"><?php if($bl->status==1){ ?>是<?php }else{ ?>否<?php } ?></td>
                <td align="center"><?php echo $bl->remark; ?></td>
                <td align="center"><?php echo date('Y-m-d',$bl->ctime); ?></td>
                <td align="center"><?php if($bl->status==1){ ?><a href="javascript:void(0);" onclick="closeShield(<?php echo $bl->id; ?>);">关闭屏蔽</a><?php }else{ ?><a href="javascript:void(0);" onclick="openShield(<?php echo $bl->id; ?>);">开启屏蔽</a><?php } ?> <a href="javascript:void(0);" onclick="delBlackList(<?php echo $bl->id; ?>);">删除</a></td>
            </tr>
            <?php } ?>
        </table>
    </div>
</div>
<script type="text/javascript">
    function delBlackList(id){
        var boolVar=window.confirm("确定要删除吗？");
        if(boolVar){
            $.ajax({
                url:"/user/delblacklist",
                type:"POST",
                data:{id:id},
                dataType:"json",
                success:function(result){
                    if(result.status==1){
                        alert(result.msg);
                        location.reload();
                    }else{
                        alert(result.msg);
                    }
                }
            });
        }
    }
    function closeShield(id){
        var boolVar=window.confirm("确定要关闭吗？");
        if(boolVar){
            $.ajax({
                url:"/user/closeshield",
                type:"POST",
                data:{id:id},
                dataType:"json",
                success:function(result){
                    if(result.status==1){
                        alert(result.msg);
                        location.reload();
                    }else{
                        alert(result.msg);
                    }
                }
            });
        }
    }
    function openShield(id){
        var boolVar=window.confirm("确定要开启吗？");
        if(boolVar){
            $.ajax({
                url:"/user/openshield",
                type:"POST",
                data:{id:id},
                dataType:"json",
                success:function(result){
                    if(result.status==1){
                        alert(result.msg);
                        location.reload();
                    }else{
                        alert(result.msg);
                    }
                }
            });
        }
    }
</script>